/*
 * Copyright (C) 2018 Pingan, Inc. All Rights Reserved.
 */
package com.pingan.haofang.searchcloud.index.dto;

import com.pingan.haofang.searchcloud.api.IndexRowData;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 原生查询结果
 *
 * @author zhangbi617
 */
@ApiModel(description = "原生查询结果集")
public class NativeResultDTO {

    @ApiModelProperty("查询到总记录数")
    private long totalFound;

    @ApiModelProperty("查询时间")
    private long time;

    @ApiModelProperty("当前返回录数")
    private long resultSize;

    @ApiModelProperty("数据集")
    private List<IndexRowData> result;

    @ApiModelProperty("数据集列名")
    private Set<String> resultColumns;

    @ApiModelProperty("高亮数据")
    private Map<String, Map<String, List<String>>> highlighting;


    /**
     * @return the time
     */
    public long getTime() {
        return time;
    }

    /**
     * @param time the time to set
     */
    public void setTime(long time) {
        this.time = time;
    }

    /**
     * @return the totalFound
     */
    public long getTotalFound() {
        return totalFound;
    }

    /**
     * @param totalFound the totalFound to set
     */
    public void setTotalFound(long totalFound) {
        this.totalFound = totalFound;
    }

    /**
     * @return the result
     */
    public List<IndexRowData> getResult() {
        return result;
    }

    /**
     * @param result the result to set
     */
    public void setResult(List<IndexRowData> result) {
        if (null != result && result.size() != 0) {
            IndexRowData rowData = result.get(0);
            this.setResultColumns(rowData.keySet());
        }
        this.result = result;
    }

    /**
     * @return the resultSize
     */
    public long getResultSize() {
        return resultSize;
    }

    /**
     * @param resultSize the resultSize to set
     */
    public void setResultSize(long resultSize) {
        this.resultSize = resultSize;
    }

    /**
     * @return the resultColumns
     */
    public Set<String> getResultColumns() {
        return resultColumns;
    }

    /**
     * @param resultColumns the resultColumns to set
     */
    public void setResultColumns(Set<String> resultColumns) {
        this.resultColumns = resultColumns;
    }

    public Map<String, Map<String, List<String>>> getHighlighting() {
        return highlighting;
    }

    public void setHighlighting(Map<String, Map<String, List<String>>> highlighting) {
        this.highlighting = highlighting;
    }
}
